﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;

namespace Sinacor.Infra.Tools
{
    public class ActionDataGrid : HtmlTable
    {
        public ActionDataGrid(string dataGridName)
        {
            this.SetConfiguration();
            this.ID = dataGridName;
        }

        public ActionDataGrid(string dataGridName, string[] headerCollection)
        {
            this.SetConfiguration();
            this.ID = dataGridName;
            this.Rows.Add(new HtmlTableRow());
            foreach (string s in headerCollection)
            {
                HtmlTableCell cell = new HtmlTableCell("th");
                cell.BgColor = "#999999";
                cell.InnerHtml = "<font color=#ffffff>" + s + "</font>";
                this.Rows[0].Cells.Add(cell);
            }
        }

        private void SetConfiguration()
        {
            this.Width = "100%";
            this.CellPadding = 2;
            this.CellSpacing = 1;
            this.BgColor = "#000000";
        }
    }
}